<template>
    <el-menu>
        <label v-for="menu in data" :key="menu.index">
            <el-submenu :index="menu.index" v-if="menu.children">
                <template slot="title">
                    <span>{{menu.name}}</span>
                </template>
                <label>
                    <menu-tree :data="menu.children"></menu-tree>
                </label>
            </el-submenu>
            <el-menu-item v-else :index="menu.index">
                <span slot="title">{{menu.name}}</span>
            </el-menu-item>
        </label>
    </el-menu>
</template>

<script>
    import MenuTree from "@/views/MenuTree"
    export default {
        name: "MenuTree",
        components:{
            MenuTree
        },
        data(){
            return{
                menu_data:{}
            }
        },
        props:["data"]
    }
</script>

<style scoped>

</style>